// Author: wsfuyibing <682805@qq.com>
// Date: 2025-05-28

package goods

import (
	"gitee.com/go-wares/framework-iris/framework/src/logics"
	"github.com/kataras/iris/v12"
	"server/app/http/logics/master/shop/goods/add"
	"server/app/http/logics/master/shop/goods/edit"
	"server/app/http/logics/master/shop/goods/info"
	"server/app/http/logics/master/shop/goods/list"
	"server/app/http/logics/master/shop/goods/purchase_add"
	"server/app/http/logics/master/shop/goods/purchase_list"
	"server/app/http/logics/master/shop/goods/purchase_lock"
	"server/app/http/logics/master/shop/goods/purchase_remove"
	"server/app/http/logics/master/shop/goods/remove"
	"server/app/http/logics/master/shop/goods/switcher"
)

// Controller
// 商店商品.
//
// @Middleware("authorizer")
// @Middleware("master")
type Controller struct{}

// GetPurchaseList
// 商品详情.
func (o *Controller) GetPurchaseList(i iris.Context) {
	logics.Do(i, purchase_list.New)
}

// GetInfo
// 商品详情.
func (o *Controller) GetInfo(i iris.Context) {
	logics.Do(i, info.New)
}

// GetList
// 商品列表.
func (o *Controller) GetList(i iris.Context) {
	logics.Do(i, list.New)
}

// PostAdd
// 添加商品.
func (o *Controller) PostAdd(i iris.Context) {
	logics.Do(i, add.New)
}

// PostEdit
// 编辑商品.
func (o *Controller) PostEdit(i iris.Context) {
	logics.Do(i, edit.New)
}

// PostPurchaseAdd
// 添加采购.
func (o *Controller) PostPurchaseAdd(i iris.Context) {
	logics.Do(i, purchase_add.New)
}

// PostPurchaseLock
// 冻结库存.
func (o *Controller) PostPurchaseLock(i iris.Context) {
	logics.Do(i, purchase_lock.New)
}

// PostPurchaseRemove
// 删除采购.
func (o *Controller) PostPurchaseRemove(i iris.Context) {
	logics.Do(i, purchase_remove.New)
}

// PostRemove
// 删除商品.
func (o *Controller) PostRemove(i iris.Context) {
	logics.Do(i, remove.New)
}

// PostSwitcher
// 商品上下架.
func (o *Controller) PostSwitcher(i iris.Context) {
	logics.Do(i, switcher.New)
}
